<style>
.pageFormContent dd {
    display: block;
    float: none;
    line-height: 21px;
    width: 520px;
}
</style>
<script type="text/javascript">
function getUser(){
    var parent=$("#uname").val();
    var url="{:U('Kit/ajax_users')}";
     $.ajax({
        type: "POST",
        url:url,
        data: {parent:parent},
        dataType: "json",
        success:function(data){
            if(data.status==1){
                var company = data.info.company?" 专营商公司：" + data.info.company:'';
                var realname = data.info.realname?" 联系人：" + data.info.realname:'';
                var contract_sn = data.info.contract_sn?" 合同号：" +data.info.contract_sn:'';
                $("#userinfo").text(company + realname + contract_sn);
                $("#userid").val(data.info.user_id);
                $("#roleid").val(data.info.role_id);
                $("#province").val(data.info.vesting_province);
                $("#city").val(data.info.vesting_city);
                $("#area").val(data.info.vesting_area);
            }else if(data.status==2){
                $("#userinfo").text("帐户还未开通，暂时不支持充值XV");
            }else if(data.status==0){                
                $("#userinfo").text("帐户不存在，暂时不支持充值XV");
            }else if(data.status==3){
                $("#userinfo").text("帐户关闭，暂时不支持充值XV");
            }else{
                $("#userinfo").text("帐户存在问题，暂时不支持充值XV");
                $("#userid").val('0');
                $("#roleid").val('0');
                $("#province").val('0');
                $("#city").val('0');
                $("#area").val('0');
            }
            initUI($("#userinfo"));
        }
    });
}
    
</script>
<div class="pageContent">
    <form method="post" action="{:U('Kitmoney/toagentxv')}" onsubmit="return validateCallback(this,dialogAjaxDone);">
    	<div class="tabsContent">
            <div class="pageFormContent" layouth="58">
                <dl>
                    <dt>充值金额XV：</dt>
                    <dd>
                        <input type="text" class="required" id="xv" name="xv" value="1" min="1" />
                    </dd>
                </dl>
                <dl  class="nowrap">
                    <dt>充值备注：</dt>
                    <dd>
                        <textarea name="remark" class="required" cols="30" rows="2"></textarea>
                    </dd>
                </dl>
                <dl>
                    <dt>分销商帐户：</dt>
                    <dd>
                        <input type="text" class="required" id="uname" value="" onblur="getUser();"/><p id="userinfo">输入专营商帐户后,请点击空白处</p>
                        <input  id="userid" name="userid" type="hidden" />
                        <input  id="roleid" name="roleid" type="hidden" />
                        <input  id="province" name="province" type="hidden" />
                        <input  id="city" name="city" type="hidden" />
                        <input  id="area" name="area" type="hidden" />
                    </dd>
                </dl>
            </div>
    	</div>
    	<div class="formBar">
            <ul>
                <li><div class="buttonActive"><div class="buttonContent"><input id="dosubmit" name="dosubmit" type="hidden" value="1"/><button type="submit">保存</button></div></div></li>
                <li>
                    <div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
                </li>
            </ul>
        </div>
        <div class="tabsFooter">
            <div class="tabsFooterContent"></div>
        </div>
    </form>
</div>
